/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Topka;

import java.util.logging.*;
import java.util.StringTokenizer;
import adc_lcard.ADCE140Driver;

/**
 *
 * @author Asko
 */
public class Calc {

    private static String delimeters = "+-*/,.()%^!";
    private static String whereas = "";
    static Logger log = Logger.getLogger(Calc.class.getName());

    public static void main(String[] args) throws InterruptedException {
        int time = 1000;
        int c1 = 1, c2 = 2, c3 = 3, c4 = 4;
        int v1, v2, v3, v4;
        ADCE140Driver.init();

        while (time-- > 0) {

            v1 = ADCE140Driver.getData(c1);
            v2 = ADCE140Driver.getData(c2);
            v3 = ADCE140Driver.getData(c3);
            v4 = ADCE140Driver.getData(c4);
            System.out.println("Ch1 : " + v1 + " Ch2 :" + v2 + " Ch3 : " + v3
                    + " Ch4 : " + v4);
            Thread.sleep(10);

        }
        ADCE140Driver.close();


    }

    public static double getResult(int calcType, double op1, double op2) {
        double res = 0;
        switch (calcType) {
            case ('+'): {
                break;
            }
            case ('-'): {
                break;
            }
            case ('*'): {
                break;
            }
            case ('/'): {
                break;
            }
            case ('.'): {
                break;
            }
            case (','): {
                break;
            }
            case ('('): {
                break;
            }
            case (')'): {
                break;
            }
            case ('!'): {
            }

        }


        return res;
    }

    public static void analyzeText(String str) {
        System.out.println("Start analyzing");
        StringTokenizer tok = new StringTokenizer(str, delimeters);
        String res = "";
        while (tok.hasMoreTokens()) {
            res += tok.nextToken();
        }
        System.out.println("" + res);
    }
}
